package com.atguigu.day02.tea;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @Author : 孙峰
 * @Description:
 * @Date : 2022/7/2  9:09
 */
public class Test {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        FutureTask<String> futureTask = new FutureTask<>(new T1Task());

        FutureTask<String> futureTask1 = new FutureTask<>(new T2Task(futureTask));
        Thread thread = new Thread(futureTask);
        thread.start();
        Thread thread1 = new Thread(futureTask1);
        thread1.start();
        System.out.println(futureTask1.get());
    }
}
